SuperStrict

Import "PPMd.cpp"

Extern "C"

	Function PPM_Encode(dest:Byte Ptr, source:Byte Ptr, maxOrder:Int, cutOff:Int) ' dest and source are RAMStreams, encodes from source.position to source.size
	Function PPM_Decode(dest:Byte Ptr, source:Byte Ptr, maxOrder:Int, cutOff:Int) ' likewise
	Function PPM_Init:Int(subAllocatorSize:Int)
	Function PPM_Shutdown()

End Extern

Include "system.bmx"
Include "network.bmx"
Include "graphics.bmx"
Include "audio.bmx"
Include "console.bmx"
Include "game.bmx"

AppTitle$ = "Project F"

If System.Init()	' timing, input, windows events

	If Console.Init()	' ~ debug / menu console
	
		If Network.Init()	' network connections and state
	
			If Graphics.Init() ' graphics resources and display
			
				If Audio.Init() ' sound / music resources and playback
						
					If Game.Init() ' game entity updates
							
						Repeat
						
							If Not System.Update() Then Exit
							If Not Network.Update() Then Exit
							If Not Console.Update() Then Exit
							If Not Audio.Update() Then Exit
							If Not Graphics.Update() Then Exit							
							If Not Game.Update() Then Exit

						Forever
						
						Game.Shutdown()
												
					EndIf
					
					Audio.Shutdown()
					
				EndIf
				
				Graphics.Shutdown()
				
			EndIf
			
			Network.Shutdown()
			
		EndIf
		
		Console.Shutdown()
			
	EndIf
	
	System.Shutdown()
	
EndIf

End











